package com.op.studyingliteapp.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.astuetz.PagerSlidingTabStrip.IconTabProvider;
import com.op.studyingliteapp.R;
import com.op.studyingliteapp.fragment.notes.NotesFragment;
import com.op.studyingliteapp.fragment.notif.NotifFragment;
import com.op.studyingliteapp.fragment.resource.ResourceFragment;
import com.op.studyingliteapp.fragment.seminar.SeminarFragment;

public class CoursePagerAdapter extends FragmentPagerAdapter implements
		IconTabProvider {

	private final int[] resids = { R.drawable.course_notif,
			R.drawable.course_post, R.drawable.course_ppt,
			R.drawable.course_note };

	public CoursePagerAdapter(FragmentManager fm) {
		super(fm);
	}

	@Override
	public int getCount() {
		return resids.length;
	}

	@Override
	public Fragment getItem(int position) {
		switch (position) {
		case 0:
			return new NotifFragment();
		case 1:
			return new SeminarFragment();
		case 2:
			return new ResourceFragment();
		case 3:
			return new NotesFragment();
		default:
			break;
		}
		return new NotifFragment();
	}

	@Override
	public int getPageIconResId(int position) {
		return resids[position];
	}

}
